import { mock } from './mock';
const { rr, rs } = RSocket;

const base = 'biz.hotels';
const base2 = 'biz.orders';

export function statistics() {
  return Promise.resolve(mock('szbinv.assets.statistics'));
}

export function amountStatistics() {
  return Promise.resolve(mock('szbinv.assets.dept.statistics'));
}

export function getDict(dictId) {
  return Promise.resolve(mock(`dicts.${dictId}`));
}

export function getTopItems(dictId) {
  return Promise.resolve(mock(`dicts.${dictId}.items.top`));
}

export function getItems(dictId) {
  return Promise.resolve(mock(`dicts.${dictId}.item`));
}

export function getDepartmentChart() {
  return Promise.resolve(mock('szbinv.assets.department.place.statistics'));
}

export function getCount() {
  return Promise.resolve(mock('szbinv.plans.statistics'));
}


export function getMonitorStatistics() {
  return Promise.resolve(mock('szbinv.monitors.statistics'));
}


/**
 * 统计指定条件下的酒店数量统计
 * @param {*} data
 */
export function getStatistics(args) {
  return rr({
    route: `${base}.statistics`,
    args: {
      ...args,
    },
  });
}

/**
 * 获取饼图数据
 * @param {*} args
 */
export function getPipe() {
  return rr({
    route: 'ccorders.data.index',
  });
}

/**
* 获取包车/专线柱状图 数据
* @param {*} args
*/
export function getOrderBar(args) {
  return rs({
    route: 'ccorders.order.trend',
    args: {
      search: { ...args },
    },
  });
}


/**
* 获取客户活跃趋势图 数据
* @param {*} args
*/
export function getCustom(args) {
  return rs({
    route: 'ccorders.customer.add.trend',
    args: {
      search: { ...args },
    },
  });
}

/**
* 获取客户总数量趋势图 数据
* @param {*} args
*/
export function getCustomSum(args) {
  return rs({
    route: 'ccorders.customer.all.trend',
    args: {
      search: { ...args },
    },
  });
}


/**
* 获取车辆出车趋势图 数据
* @param {*} args
*/
export function getVehicle(args) {
  return rs({
    route: 'ccorders.vehicle.active.trend',
    args: {
      search: { ...args },
    },
  });
}
/**
* 获取车辆总数量趋势图 数据
* @param {*} args
*/
export function getVehicleSum(args) {
  return rs({
    route: 'ccorders.vehicle.all.trend',
    args: {
      search: { ...args },
    },
  });
}

/**
* 获取车辆总数量  时间之前的
* @param {*} args
*/
export function getVehicleCount(args) {
  return rr({
    route: 'ccorders.vehicle.trend.count',
    args: {
      search: { ...args },
    },
  });
}

/**
* 获取客户总数量  时间之前的
* @param {*} args
*/
export function getCustomCount(args) {
  return rr({
    route: 'ccorders.customer.trend.count',
    args: {
      search: { ...args },
    },
  });
}
